package com.bdqn.service;

import com.bdqn.pojo.SysUser;
import org.apache.ibatis.annotations.Param;

import java.sql.Connection;
import java.util.List;

public interface SysUserService {
    /**
     * 实现登录的功能
     */
    SysUser login(String account, String password) throws Exception;

    /**
     * 根据角色名称、角色id查询总数据量
     * @param realName
     * @param roleId
     * @return
     */
    int getUserCount(@Param("realName") String realName, @Param("roleId") int roleId);

    /**
     * 分页查询
     * @param realName
     * @param roleId
     * @return
     */
    List<SysUser> getUserList(@Param("realName") String realName, @Param("roleId") int roleId,
                              @Param("pageIndex") int pageIndex, @Param("pageSize") int pageSize);


    int add(SysUser sysUser);

    int add(Connection connection, SysUser sysUser);

    SysUser getUserById(String id);

    boolean update(SysUser sysUser);

    /**
     * 根据账号查询用户
     *
     * @param account
     * @return
     */
    List<SysUser> queryByAccount(String account);
}
